<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var age = new Array(1, 2,[3, 4, 5]);
    age = new Array([1, 2, 3, 4, 5]);
    age = [1, 2, 3, 4, 5];
    age = new Array(10); // length为10
    console.log(age);
    var num = [1, 3, 2, 0, 6, 1, 9, 4];
    // 从小到大排列
    console.log(num.sort(function (a, b) {
        return a - b;
    }));
    // splice增删改数值元素
    console.log(num.splice(0, 8, "a", "b"), num);
    // filter过滤
    var oldArray = [1, 2, 100, 1000, "a", null];
    var newArray = oldArray.filter(function (value, index, array) {
        console.log(array);
        if (typeof value === "number") {
            return value;
        }
    });
    console.log(newArray);
</script>
</body>
</html>